<template>
    <div class="main-page-container">
        <main-msg></main-msg>
    </div>
    <main-bottomer></main-bottomer>
</template>

<script>
import mainTopper from "../main/mainTopper.vue";
import mainBottomer from "../main/mainBottomer.vue";
import mainMsg from "./mian/mainMsg.vue";
import {userApi} from "../../api/userAPi.js";
import {useStore} from "vuex";
import {onMounted} from "vue";
export default {
    name: "mainPage",
    components:{
        mainTopper,
        mainBottomer,
        mainMsg
    },
    setup() {
        let store = useStore()

        async function init() {
            let uid = '261629123'//store.state.loginStore.uid
            await userApi.userDetail(uid,(res)=>{
                store.commit('userStore/setUserDetail',res.data)
            })
            await userApi.userAccount((res)=>{
                store.commit('userStore/setUserAccount',res.data.account)
            })

        }

        onMounted(()=>{
            init()
        })
    },
}
</script>

<style scoped>
    .main-page-container {
        width: 100%;
        height: calc(100% - 72px);
        background-color: white;
    }
</style>